package com.kuang.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kuang.entity.Gift;
import com.kuang.service.GiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类说明
 *
 * @author liaosheng
 * @date 2021-04-29
 */
@RestController
@RequestMapping(value = "/gift")
public class GiftController {
    @Autowired
    private GiftService giftService;
    @GetMapping("/list")
    public Page<Gift>list(){
        return giftService.page();
    }
    @PostMapping("/add")
    public void add(Gift gift){
       giftService.add(gift);
    }
    @PostMapping("/update")
    public void update (Gift gift){
        giftService.update(gift);
    }
}
